home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Checkvga.pxl < prev    next >
Text File  |  2000-12-23  |  5KB  |  194 lines

  1. {-----------------------------------------------------------------------
  2.     Filename    : checkVGA.pxl
  3.     Purpose    : Check current Windows driver parameters
  4.     Date        : v4.2  20-nov-98
  5.     Author        : S.Dibbs, VYSOR Integration Inc
  6.  
  7. ------------------------------------------------------------------------}
  8.  
  9. Initialize:
  10. { Get the screen parameters and adjust the main window for a fixed size. }
  11.  
  12.     NewCaption$ = "Verify Windows Data"
  13.     UseCoordinates(METRIC)    {note this is not PIXEL}
  14.     WinGetActive(OldCaption$)
  15.     WinTitle(OldCaption$,NewCaption$) 
  16.     WinLocate(NewCaption$,1,1,280,210, Res)  
  17.     UseBackground(TRANSPARENT,0,0,80) {Black}
  18.     DrawBackground
  19.     
  20. Restart:
  21.     GetScreenCaps(HORZRES, X_res)
  22.     GetScreenCaps(VERTRES, Y_res)
  23.     GetScreenCaps(HORZSIZE, X_size)
  24.     GetScreenCaps(VERTSIZE, Y_size)
  25.     GetScreenCaps(NUMCOLORS,Colours)
  26.     If Colours = -1 Then Colours = 4096
  27.     GetScreenCaps(BITSPIXEL,BitsPerPixel)
  28.     GetScreenCaps(PLANES,BitPlanes)
  29.     
  30.     WaitInput(100)
  31.     SetMenu("Exit!",Run_Leave,
  32.         ENDPOPUP,
  33.         " ",VGA,
  34.         ENDPOPUP,
  35.         "  ",SVGA,
  36.         ENDPOPUP,
  37.         "   ",WKS,
  38.         ENDPOPUP,
  39.         "Vert",IGNORE,
  40.         "Red",Red,
  41.         "Green",Green,
  42.         "Blue",Blue,
  43.         "Restart",Restart,
  44.         ENDPOPUP,
  45.         "Diag",Diag,
  46.         ENDPOPUP,
  47.         "About",About,
  48.         ENDPOPUP)
  49.  
  50. Display:
  51.     Str(X_Res,X_Res$)
  52.     Str(Y_Res,Y_Res$)
  53.     Str(X_Size,X_Size$)
  54.     Str(Y_Size,Y_Size$)
  55.     Str(Colours,Colours$)
  56.     Str(BitsPerPixel,BitsPerPixel$)
  57.     Str(BitPlanes,BitPlanes$)
  58.  
  59.     Line1$ = "Screen Resolution is " + X_Res$
  60.     Line1$ = Line1$ + " x "
  61.     Line1$ = Line1$ + Y_Res$
  62.     Line1$ = Line1$ + " pixels"
  63.  
  64.     Line2$ = "Screen Size is " + X_Size$
  65.     Line2$ = Line2$ + " x "
  66.     Line2$ = Line2$ + Y_Size$
  67.     Line2$ = Line2$ + " millimeters"
  68.  
  69.     Line3$ = "Static Number of colours is " + Colours$
  70.  
  71.     Line4$ = "Bits per pixel  is " + BitsPerPixel$
  72.  
  73.     Line5$ = "Number of Bitplanes is " +  BitPlanes$
  74.  
  75.     UseFont("Arial",5,10,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  76.     DrawText(20,20,Line1$)
  77.     DrawText(20,30,Line2$)
  78.     DrawText(20,40,Line3$)
  79.     DrawText(20,50,Line4$)
  80.     DrawText(20,60,Line5$)
  81.  
  82.     UseFont("Arial",3,7,BOLD,NOITALIC,NOUNDERLINE,255,255,0)
  83.     If X_Res = 640 Then  Line1$ = "Hence, your monitor is VGA compatible, and"
  84.     If X_Res = 800 Then  Line1$ = "Hence, your monitor is SVGA compatible, and"
  85.     If X_Res = 1024 Then  Line1$ = "Hence, your monitor is XGA compatible, and"
  86.     If X_Res > 1024 Then  Line1$ = "Hence, you have a high end PC, and "
  87.  
  88.     If Colours < 20 Then Line2$ = "you have an older PC or early model colour Laptop."
  89.     If Colours = 20 Then Line2$ = "the number of available dynamic colours is 236."
  90.     If Colours > 20 Then Line2$ = "you are probably running a hi-colour or 24 bit video card."
  91.  
  92.     Line3$ = "Number of Bitplanes is " +  BitPlanes$
  93.  
  94.     DrawText(20,80,Line1$)
  95.     DrawText(20,90,Line2$)
  96.  
  97.     If  X_Res >= 1024 Then Goto Done
  98.         Line3$ = "Concept! programs display best at higher"
  99.         Line4$ = "resolutions. Please check if your video card"
  100.         Line5$ = "and monitor supports either 800x600 or"
  101.         Line6$ = "1024x768x256 colours. Setup this mode."
  102.         DrawText(25,100,Line3$)
  103.         DrawText(25,110,Line4$)
  104.         DrawText(25,120,Line5$)
  105.         DrawText(25,130,Line6$)
  106.     {endif}
  107. Done:
  108.  
  109. Wait_for_input:
  110.     WaitInput()
  111.  
  112.  
  113.  
  114. VGA:
  115.     X_Res = 640    
  116.     Y_Res = 480     
  117.     DrawBackground    Goto Display
  118. SVGA:
  119.     X_Res = 800    
  120.     Y_Res = 600     
  121.     DrawBackground    Goto Display
  122. WKS:
  123.     X_Res = 1280
  124.     Y_Res = 1024    
  125.     Colours = 4096    
  126.     DrawBackground    Goto Display
  127.  
  128.  
  129.  
  130. Red:
  131.     UsePen(SOLID,1,255,0,0)
  132.     Goto Vertical 
  133. Green:
  134.     UsePen(SOLID,1,0,255,0)
  135.     Goto Vertical 
  136. Blue:
  137.     UsePen(SOLID,1,0,0,255)
  138. Vertical:
  139.     GoSub Vertical_Drape
  140.     Goto Wait_for_input
  141.  
  142. Diag:
  143.     GoSub Diag_Drape
  144.     Goto Wait_for_input
  145.  
  146. Run_Leave:
  147.     End
  148.  
  149.  
  150. About:
  151.     AboutUser("About Check VGA","Windows 95/98/NT sample application","")
  152.     Goto Wait_for_Input
  153.  
  154. {======================================================================}
  155. {Subroutine: }
  156. Vertical_Drape:
  157.     UseCoordinates(PIXEL) 
  158.     X1 = 511     X2 = 512    X3 = 255    X4 = 768
  159.     Y1 = 1  Y2 = 768
  160. Loop1:
  161.     DrawLine(X1,1,X1,768)
  162.     DrawLine(X2,1,X2,768)
  163.     DrawLine(X3,1,X3,768)
  164.     DrawLine(X4,1,X4,768)
  165.     If X3 = 0 Then X3 = 1
  166.     X1 = X1 - 1     X2 = X2 + 1
  167.     X3 = X3 - 1     X4 = X4 + 1
  168.     If X1 > 255 Then Goto Loop1
  169.     UseCoordinates(METRIC) 
  170.  
  171.     Return
  172.  
  173. {Subroutine: }
  174. Diag_Drape:
  175.     UsePen(SOLID,1,0,128,0)
  176.     UseCoordinates(PIXEL) 
  177.     X1 = 522     X2 = 777    X3 = 256    X4 = 511
  178. Loop2:
  179.     DrawLine(X1,1,X2,768)
  180.     DrawLine(X3,1,X4,768)
  181.     X1 = X1 + 1     X2 = X2 + 1
  182.     X3 = X3 + 1     X4 = X4 + 1
  183.     If X1 < 768 Then Goto Loop2
  184.  
  185.     X1 = 1     X2 = 255    
  186. Loop3:
  187.     DrawLine(X1,1,X2,768)
  188.     X1 = X1 + 1     X2 = X2 + 1
  189.     If X1 < 250 Then Goto Loop3
  190.  
  191.     UseCoordinates(METRIC) 
  192.  
  193.     Return
  194.